#ifndef DEFINES_H_
#define DEFINES_H_

#define CUADRADO 1

#define CUADRICULADO 10 * CUADRADO
#define ANCHO_DE_CUADRICULADO 2.0

//Color que tendran las lineas de los conectores. (negro)
#define COLOR_LINE_CONECTORS 0, 0, 0
//Color que tendra el perimetro de los componentes. (negro)
#define COLOR_LINE_COMPONENTS 0, 0, 0
//Color que tendra el relleno de los componentes. (gris)
#define COLOR_COMPONENT 0.95, 0.95, 0.95

#define PROP_SUBDIAGRAM 0.35

//Margen adicional que dara el highlight.
#define HIGHLIGHT 3 * CUADRADO
#define ANCHO_DE_LINEA_HIGHLIGHT 0.5
#define COLOR_HIGHLIGHT 0, 0, 0

#define ANCHO_DE_LINEA_SELECCION 0.5
#define COLOR_SELECCION 0, 0, 0

#define ANCHO_DE_LINEA 1.5

#define ANCHO_DE_LINEA_CONECTOR 0.5

#define ENTITY_HORIZONTAL_LINE 30 * CUADRADO
#define ENTITY_VERTICAL_LINE ENTITY_HORIZONTAL_LINE
#define ENTITY_ENTRADA_0 0, 0
#define ENTITY_ENTRADA_1 0, ENTITY_VERTICAL_LINE * 1 / 5.0
#define ENTITY_ENTRADA_2 0, ENTITY_VERTICAL_LINE * 2 / 5.0
#define ENTITY_ENTRADA_3 0, ENTITY_VERTICAL_LINE * 3 / 5.0
#define ENTITY_ENTRADA_4 0, ENTITY_VERTICAL_LINE * 4 / 5.0
#define ENTITY_ENTRADA_5 (2 * ENTITY_HORIZONTAL_LINE) * 0.5 / 5.0, 0
#define ENTITY_ENTRADA_6 (2 * ENTITY_HORIZONTAL_LINE) * 1.5 / 5.0, 0
#define ENTITY_ENTRADA_7 (2 * ENTITY_HORIZONTAL_LINE) * 2.5 / 5.0, 0
#define ENTITY_ENTRADA_8 (2 * ENTITY_HORIZONTAL_LINE) * 3.5 / 5.0, 0
#define ENTITY_ENTRADA_9 (2 * ENTITY_HORIZONTAL_LINE) * 4.5 / 5.0, 0
#define ENTITY_ENTRADA_10 (2 * ENTITY_HORIZONTAL_LINE) * 1 / 5.0, 0
#define ENTITY_ENTRADA_11 (2 * ENTITY_HORIZONTAL_LINE) * 2 / 5.0, 0
#define ENTITY_ENTRADA_12 (2 * ENTITY_HORIZONTAL_LINE) * 3 / 5.0, 0
#define ENTITY_ENTRADA_13 (2 * ENTITY_HORIZONTAL_LINE) * 4 / 5.0, 0
#define ENTITY_ENTRADA_14 (2 * ENTITY_HORIZONTAL_LINE) * 5 / 5.0, 0
#define ENTITY_ENTRADA_15 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 0.5 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_16 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 1.5 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_17 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 2.5 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_18 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 3.5 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_19 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 4.5 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_20 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 1 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_21 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 2 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_22 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 3 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_23 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 4 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_24 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS) * 5 / 5.0, ENTITY_VERTICAL_LINE * 0.8
#define ENTITY_ENTRADA_25 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS), ENTITY_VERTICAL_LINE * 0.8 / 5.0
#define ENTITY_ENTRADA_26 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS), ENTITY_VERTICAL_LINE * 0.8 * 2 / 5.0
#define ENTITY_ENTRADA_27 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS), ENTITY_VERTICAL_LINE * 0.8 * 3 / 5.0
#define ENTITY_ENTRADA_28 (2 * ENTITY_HORIZONTAL_LINE + CONECTOR_RADIUS), ENTITY_VERTICAL_LINE * 0.8 * 4 / 5.0

#define ENTITY_INFLUENCE_RECTANGLE_XF 2 * ENTITY_HORIZONTAL_LINE + 2 * CONECTOR_RADIUS
#define ENTITY_INFLUENCE_RECTANGLE_YF ENTITY_HORIZONTAL_LINE

#define COMPOSITEATTRIBUTE_HORIZONTAL_LINE ENTITY_HORIZONTAL_LINE * 0.8
#define COMPOSITEATTRIBUTE_VERTICAL_LINE ENTITY_HORIZONTAL_LINE * 0.8
#define COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF (COMPOSITEATTRIBUTE_HORIZONTAL_LINE + 2 * CONECTOR_RADIUS)
#define COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF (COMPOSITEATTRIBUTE_HORIZONTAL_LINE + 2 * CONECTOR_RADIUS)
#define COMPOSITEATTRIBUTE_SALIDA_0 0, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF / 2
#define COMPOSITEATTRIBUTE_SALIDA_1 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF / 2
#define COMPOSITEATTRIBUTE_SALIDA_2 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF / 2, 0
#define COMPOSITEATTRIBUTE_SALIDA_3 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF / 2, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF
#define COMPOSITEATTRIBUTE_SALIDA_4 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 1 / 4 - CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 1 / 4 - CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_5 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 3 / 4 + CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 1 / 4 - CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_6 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 1 / 4 - CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 3 / 4 + CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_7 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 3 / 4 + CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 3 / 4 + CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_8 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 1 / 4 + CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 1 / 4 - 2 * CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_9 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 3 / 4 - CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 1 / 4 - 2 * CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_10 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 1 / 4 + CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 3 / 4 + 2 * CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_11 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 3 / 4 - CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 3 / 4 + 2 * CONECTOR_RADIUS
#define COMPOSITEATTRIBUTE_SALIDA_12 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 1 / 4 - 2 * CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 1 / 4
#define COMPOSITEATTRIBUTE_SALIDA_13 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 3 / 4 + 2 * CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 1 / 4
#define COMPOSITEATTRIBUTE_SALIDA_14 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 1 / 4 - 2 * CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 3 / 4
#define COMPOSITEATTRIBUTE_SALIDA_15 COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_XF * 3 / 4 + 2 * CONECTOR_RADIUS, COMPOSITEATTRIBUTE_INFLUENCE_RECTANGLE_YF * 3 / 4

#define RELATION_VERTICAL_LINE 30 * CUADRADO
#define RELATION_HORIZONTAL_DISPLACEMENT RELATION_VERTICAL_LINE * 2
#define RELATION_INFLUENCE_RECTANGLE_YF RELATION_VERTICAL_LINE
#define RELATION_INFLUENCE_RECTANGLE_XF RELATION_HORIZONTAL_DISPLACEMENT + 2 * CONECTOR_RADIUS

#define RELATION_ENTRADA_0 0, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 - 3
#define RELATION_ENTRADA_01 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.2, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.8 - 3
#define RELATION_ENTRADA_02 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.4, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.6 - 3
#define RELATION_ENTRADA_03 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.6, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.4 - 3
#define RELATION_ENTRADA_04 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.8, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.2 - 3
#define RELATION_ENTRADA_1 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2, 0
#define RELATION_ENTRADA_11 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.2, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.2 - 3
#define RELATION_ENTRADA_12 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.4, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.4 - 3
#define RELATION_ENTRADA_13 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.6, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.6 - 3
#define RELATION_ENTRADA_14 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.8, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 0.8 - 3
#define RELATION_ENTRADA_2 CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 - 3
#define RELATION_ENTRADA_21 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.8, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.2 - 3
#define RELATION_ENTRADA_22 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.6, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.4 - 3
#define RELATION_ENTRADA_23 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.4, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.6 - 3
#define RELATION_ENTRADA_24 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 1.2, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.8 - 3
#define RELATION_ENTRADA_3 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2, (RELATION_INFLUENCE_RECTANGLE_YF) - 3
#define RELATION_ENTRADA_31 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.8, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.8 - 3
#define RELATION_ENTRADA_32 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.6, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.6 - 3
#define RELATION_ENTRADA_33 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.4, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.4 - 3
#define RELATION_ENTRADA_34 (CONECTOR_RADIUS + RELATION_HORIZONTAL_DISPLACEMENT) / 2 * 0.2, (RELATION_INFLUENCE_RECTANGLE_YF) / 2 * 1.2 - 3


//Distancia que hay (en Y) entre el texto y el componente.
#define DISTANCE_OF_TEXT_FROM_COMPONENT 12 * CUADRADO
//Ancho de linea que tendra el texto.
#define SIZE_TEXT 0.5
//Descripcion de la fuente del texto
#define FONT_DESCRIPTION "sans 8"
//Color que tendra el texto.
#define COLOR_IN_TEXT 0,0,128

#define CONECTOR_RADIUS 3 * CUADRADO
#define CONECTOR_INFLUENCE_RECTANGLE_XF 2 * CONECTOR_RADIUS
#define CONECTOR_INFLUENCE_RECTANGLE_YF CONECTOR_INFLUENCE_RECTANGLE_XF

#define ATTRIBUTE_RADIUS 8 * CUADRADO
#define ATTRIBUTE_INFLUENCE_RECTANGLE_XF ATTRIBUTE_RADIUS * 2
#define ATTRIBUTE_INFLUENCE_RECTANGLE_YF ATTRIBUTE_INFLUENCE_RECTANGLE_XF
#define ATTRIBUTE_ONLY_CONECTOR ATTRIBUTE_RADIUS - CONECTOR_RADIUS, ATTRIBUTE_RADIUS - CONECTOR_RADIUS

#define DIST_FORK 40 * CUADRADO
#define FORK_ENTRADA_0 DIST_FORK / 2, 0
#define FORK_ENTRADA_1000 0, 0
#define FORK_ENTRADA_100 DIST_FORK / 8, DIST_FORK / 4
#define FORK_ENTRADA_10 DIST_FORK / 6, DIST_FORK / 3
#define FORK_ENTRADA_1 DIST_FORK / 4, DIST_FORK / 2
#define FORK_ENTRADA_13 DIST_FORK / 3, DIST_FORK / 1.5
#define FORK_ENTRADA_3 DIST_FORK / 2, DIST_FORK
#define FORK_ENTRADA_32 5 * DIST_FORK / 8, DIST_FORK / 1.5
#define FORK_ENTRADA_2 3 * DIST_FORK / 4, DIST_FORK / 2
#define FORK_ENTRADA_20 5 * DIST_FORK / 6, DIST_FORK / 3
#define FORK_ENTRADA_200 7 * DIST_FORK / 8, DIST_FORK / 4
#define FORK_ENTRADA_2000 DIST_FORK, 0

#define FORK_INFLUENCE_RECTANGLE_XF DIST_FORK + 2 * CONECTOR_RADIUS
#define FORK_INFLUENCE_RECTANGLE_YF DIST_FORK + 2 * CONECTOR_RADIUS

#define COLOR_DRAGING 200, 100, 0

#endif /* DEFINES_H_ */
